class CreateUser < ActiveRecord::Migration
  def self.up
    create_table "users" do |t|
      t.column "login",        :string,   :limit => 40,  :default => "",    :null => false
      t.column "name",         :string,   :limit => 128, :default => "",    :null => false
      t.column "admin",        :integer,  :limit => 1,   :default => 0,     :null => false
      t.column "activated",    :integer,  :limit => 1,   :default => 0,     :null => false
      t.column "email",        :string,   :limit => 80,  :default => "",    :null => false
      t.column "cypher",       :text,                    :default => "",    :null => false
      t.column "salt",         :string,   :limit => 40,  :default => "",    :null => false
      t.column "token",        :string,   :limit => 10,  :default => "",    :null => false
      t.column "token_expiry", :datetime
      t.column "lock_version", :integer,                 :default => 0,     :null => false
      t.column "ldap_dn",      :string
      t.column "is_local",     :boolean,                 :default => false
      t.column "visibility",   :string
      t.column "created_on",   :datetime
      t.column "updated_on",   :datetime
    end
  
    add_index "users", ["login"], :name => "login"
    add_index "users", ["email"], :name => "email"
  end

  def self.down
    drop_table 'users'
  end
end
